package sale.wxb.loveshopping.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import sale.wxb.loveshopping.entity.common.Result;
import sale.wxb.loveshopping.service.IAuthenticationService;

@RestController
@RequestMapping("/auth")
@Api(tags = { "登录、认证" })
public class AuthenticationController {

    @Autowired
    private IAuthenticationService authenticationService;

    @PostMapping("loginByPhoneSms")
    @ApiOperation(value = "使用手机验证码登录", notes = "如该手机号未注册时将自动注册")
    public void loginByPhoneSms() {

    }

    @GetMapping("logOut")
    @ApiOperation("退出登录")
    public Result<Boolean> logOut() {
        return Result.success(authenticationService.logout());
    }
}
